#ifndef __MINOS_HYPERCALL_H__
#define __MINOS_HYPERCALL_h__

/* below defination is for HVC call */
#define HVC_TYPE_VM0			(0x8)
#define HVC_TYPE_MISC			(0x9)
#define HVC_TYPE_VMBOX			(0xa)
#define HVC_TYPE_DEBUG_CONSOLE		(0xb)

#define HVC_CALL_BASE			(0xc0000000)

#define HVC_CALL_NUM(t, n)		(HVC_CALL_BASE + (t << 24) + n)

#define HVC_VM0_FN(n)			HVC_CALL_NUM(HVC_TYPE_VM0, n)
#define HVC_MISC_FN(n)			HVC_CALL_NUM(HVC_TYPE_MISC, n)
#define HVC_VMBOX_FN(n)			HVC_CALL_NUM(HVC_TYPE_VMBOX, n)
#define HVC_VMBOX_DEBUG_CONSOLE(n)	HVC_CALL_NUM(HVC_TYPE_DEBUG_CONSOLE, n)

/* hypercall for vm releated operation */
#define	HVC_VM_CREATE			HVC_VM0_FN(0)
#define HVC_VM_DESTORY			HVC_VM0_FN(1)
#define HVC_VM_RESTART			HVC_VM0_FN(2)
#define HVC_VM_POWER_UP			HVC_VM0_FN(3)
#define HVC_VM_POWER_DOWN		HVC_VM0_FN(4)
#define HVC_VM_MMAP			HVC_VM0_FN(5)
#define HVC_VM_UNMMAP			HVC_VM0_FN(6)
#define HVC_VM_SEND_VIRQ		HVC_VM0_FN(7)
#define HVC_VM_CREATE_VMCS		HVC_VM0_FN(8)
#define HVC_VM_CREATE_VMCS_IRQ		HVC_VM0_FN(9)
#define HVC_VM_REQUEST_VIRQ		HVC_VM0_FN(10)
#define HVC_VM_VIRTIO_MMIO_INIT		HVC_VM0_FN(11)
#define HVC_VM_VIRTIO_MMIO_DEINIT	HVC_VM0_FN(12)
#define HVC_VM_CREATE_RESOURCE		HVC_VM0_FN(13)
#define HVC_CHANGE_LOG_LEVEL		HVC_VM0_FN(14)

#define HVC_GET_VMID			HVC_MISC_FN(0)
#define HVC_SCHED_OUT			HVC_MISC_FN(1)

#define HVC_DC_GET_STAT			HVC_VMBOX_DEBUG_CONSOLE(0)
#define HVC_DC_GET_RING			HVC_VMBOX_DEBUG_CONSOLE(1)
#define HVC_DC_GET_IRQ			HVC_VMBOX_DEBUG_CONSOLE(2)
#define HVC_DC_WRITE			HVC_VMBOX_DEBUG_CONSOLE(3)
#define HVC_DC_OPEN			HVC_VMBOX_DEBUG_CONSOLE(4)
#define HVC_DC_CLOSE			HVC_VMBOX_DEBUG_CONSOLE(5)

#endif
